﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.Entity;
using COM.OA.BLL;

public partial class qs_rizhi_piyuedelete : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        users loginuser = Session["loginuser"] as users;
        if (loginuser == null)
        {
            this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
            return;
        }
        else if (loginuser.u_dept_id != 1)
        {
            this.Response.Write(string.Format(GetRedirect.WINALERT, "您不是经理没有批阅条件"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "rizhipiyue.aspx"));
        }
        else
        {
            string id = this.Request.QueryString["w_id"];
            int wid = Int32.Parse(id);
            worklog wl = worklogBLL.Select(wid);


            //重新封装
            worklog wll = new worklog();
            wll.w_id = wl.w_id;
            wll.w_title = wl.w_title;
            wll.w_clicks = wl.w_clicks;
            wll.w_content = wl.w_content;
            wll.w_sendtime = wl.w_sendtime;
            //讨论后再定
            wll.w_state = wl.w_state;
            wll.w_u_id = wl.w_u_id;
            wll.w_readerid = 0;
            wll.w_readcontent = "";
            wll.w_readtime = DateTime.Parse("2008-01-01");
            worklogBLL.Update(wll);
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "rizhipiyue.aspx"));
        }
    }
}
